﻿/**
 * Copyright (c) 2008 Justin Etheredge http://www.codethinked.com
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Microsoft Public License (Ms-PL)
 * which accompanies this distribution, and is available at
 * http://www.opensource.org/licenses/ms-pl.html
 * If redistributing this code, this entire header must remain intact.
 * 
 * Some of the code in this application has been taken 
 * from the following sources (all of which are licensed under
 * the Ms-PL):
 * Matt Warren's Blog: http://blogs.msdn.com/mattwar/
 * MSDN: http://msdn2.microsoft.com/en-us/library/bb546158.aspx
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Amazon.SimpleDB;
using Amazon.SimpleDB.Mock;

namespace LinqToSimpleDBTest
{
  internal class TestSetup
  {
    public static string awsAccessKey = "accesskey";
    public static string awsSecretKey = "secretkey";

    private static bool useMockClient = true;

    public static bool UseMockClient
    {
      get { return useMockClient; }
    }

    public static LinqToSimpleDB.SimpleDBContext GetContext(string domain)
    {
      AmazonSimpleDB simpleDBClient = null;
      if (useMockClient)
      {
        simpleDBClient = new AmazonSimpleDBMock();
      }
      else
      {
        simpleDBClient = new AmazonSimpleDBClient(awsAccessKey, awsSecretKey);
      }
      var context = LinqToSimpleDB.SimpleDBContext.GetContext(simpleDBClient, awsAccessKey, awsSecretKey, domain);
      return context;
    }
  }
}
